home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4846 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.3 KB  |  51 lines

  1. Newsgroups: comp.lang.c++
  2. Path: esds01.es.dupont.com!news
  3. From: Malcolm Smart <MALCOLM.SMART@CONOCO.DUPONT.COM>
  4. Subject: Streams & Arrays (2nd attempt)
  5. Content-Type: text/plain; charset=us-ascii
  6. Message-ID: <1996Feb1.110824.7077@es.dupont.com>
  7. Sender: news@es.dupont.com (USENET News System)
  8. Nntp-Posting-Host: slai99.wrk.dupont.com
  9. Content-Transfer-Encoding: 7bit
  10. Organization: Conoco/DuPont
  11. Mime-Version: 1.0
  12. Date: Thu, 1 Feb 1996 11:08:24 GMT
  13. X-Mailer: Mozilla 1.1 (Windows; I; 16bit)
  14.  
  15. Try again...
  16.  
  17. Can anyone help with the following :-
  18.  
  19. class TMyClass
  20.    {
  21.    public:
  22.       TMyClass() {};
  23.    private:
  24.       char Name[255];
  25.    }; //simple class
  26.  
  27. typedef TArray<TMyClass> TMyClasses;
  28. typedef TArrayIterator<TMyClass> TMyClassIterator;
  29.  
  30. The compile reports an error in <vectimp.h> when trying to compile the 
  31. above.  There's more code below, but that's irrelevant (I think).
  32.  
  33. Can someone confirm that the above code is the correct way to define an 
  34. arraytype of TMyClass and an iterator for that array.
  35.  
  36. I would also like to iterate through an array of TMyClass and stream 
  37. 'Name' to a file using <<.  It is easy enough for someone out there to 
  38. explain the easiest way to get << into my class, and how to apply that 
  39. using an iterator.
  40.  
  41. I'm not asking for much!!
  42.  
  43. regards
  44.  
  45. Malc.
  46.  
  47. --The above is all mine and no one elses.
  48.  
  49.  
  50.  
  51.